package com.yaowk.sfp.demo.consume.controller;

import com.yaowk.sfp.common.base.BaseException;
import com.yaowk.sfp.demo.DemoApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo/consume")
public class DemoController {

    @Autowired
    private DemoApi demoApi;

    @GetMapping
    public void get() {
        demoApi.api1Get();
        System.out.println(demoApi.api1Post());
        System.out.println(demoApi.api1Put());
    }

    @GetMapping("/exception")
    public void excep() {
        throw new BaseException("consume exception");
    }
}
